Skip to content

Fix crash in _parse_card_note when eventType is null#365

Merged
RealCLanger merged 1 commit into
pytr-org:masterfrom
Titouan-Loeb:fix-card-note-null-event-type
Jul 20, 2026
Merged

Fix crash in _parse_card_note when eventType is null#365
RealCLanger merged 1 commit into
pytr-org:masterfrom
Titouan-Loeb:fix-card-note-null-event-type

Conversation

@Titouan-Loeb

Copy link
Copy Markdown
Contributor

event_dict.get("eventType", "") only falls back to "" when the key is missing, not when it is present but null, which Trade Republic sends for some card events. That None then hits .startswith("card_") and raises AttributeError: 'NoneType' object has no attribute 'startswith'.

Added a regression fixture with eventType explicitly null (the existing kartenzahlung_no_eventType.json only covers the key being absent, a different case)

event_dict.get("eventType", "") only falls back to "" when the key
is missing, not when it's present but null, which Trade Republic
sends for some card events. That None then hits .startswith("card_")
and raises AttributeError.

Added a regression fixture with eventType explicitly null (existing
kartenzahlung_no_eventType.json only covers the key being absent).
@RealCLanger
RealCLanger merged commit 080bc59 into pytr-org:master Jul 20, 2026
5 checks passed
@RealCLanger

Copy link
Copy Markdown
Collaborator

Makes sense. Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants